﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GeometryViz3D.Views;
using GeometryViz3D.Model;
using System.Windows;

namespace GeometryViz3D.Services
{
    public class EditModelService : IEditModelService
    {
        G3DModel m_model;

        public G3DModel Model
        {
            get { return m_model; }
        }

        public bool ShowDialog(G3DModel model)
        {
            EditModelDialog dlg = new EditModelDialog(model);

            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                try
                {
                    m_model = dlg.Model;
                    return true;
                }
                catch (G3DException ex)
                {
                    MessageBox.Show(ex.Message, "GeometryViz3D");
                }
            }

            return false;
        }
    }
}
